package com.wu.home.controller;

import com.wu.home.entity.User;
import com.wu.home.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @Value("${kfile}")
    private String profile;

    @GetMapping("/profile")
    public String getProfile()
    {
        return profile;
    }

    @GetMapping("/getUser")
    public User getUser(String username)
    {
        User user = this.userService.queryUser(username);
        return user;
    }


}
